﻿<UserControl x:Class="KouDai.Phone.Views.HotView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:ImageUI="clr-namespace:WPNextTools.NControls;assembly=WPNextTools"
             xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:vm="clr-namespace:KouDai.Phone.ViewModels"
             FontFamily="{StaticResource PhoneFontFamilyNormal}"
             FontSize="{StaticResource PhoneFontSizeNormal}"
             Foreground="{StaticResource PhoneForegroundBrush}"
             cal:Bind.AtDesignTime="True"
             d:DataContext="{d:DesignInstance Type=vm:HotViewModel,
                                              IsDesignTimeCreatable=true}"
             d:DesignHeight="800"
             d:DesignWidth="480"
             mc:Ignorable="d">

    <Grid x:Name="LayoutRoot">
        <ImageUI:PhotoListBox x:Name="HotImageWall" ItemsSource="{Binding HotItems}">
            <ImageUI:PhotoListBox.StrategyDefinition>
                <ImageUI:PhotoVirtualizationStrategyDefinition ColumnCount="2"
                                                               ColumnMargin="10"
                                                               LeftRightMargin="12"
                                                               Orientation="Vertical" />
            </ImageUI:PhotoListBox.StrategyDefinition>
            <ImageUI:PhotoListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Background="{StaticResource ImageWallBackBrush}">
                        <Image Source="{Binding ImageUrl}" Stretch="UniformToFill" />
                        <Grid Height="45" VerticalAlignment="Bottom">
                            <Rectangle Fill="{Binding RectColor}" />
                            <TextBlock Margin="10,0,0,0"
                                       VerticalAlignment="Center"
                                       Foreground="White"
                                       Text="{Binding OriginalAppName}" />
                        </Grid>
                    </Grid>
                </DataTemplate>
            </ImageUI:PhotoListBox.ItemTemplate>
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="ItemTap">
                    <cal:ActionMessage MethodName="GoToDetail">
                        <cal:Parameter Value="{Binding SelectedItem, ElementName=HotImageWall}" />
                    </cal:ActionMessage>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </ImageUI:PhotoListBox>
    </Grid>
</UserControl>